package observer;

import java.awt.Canvas;
import java.awt.Graphics;
import java.awt.Color;

public class ValoareCurentaBara extends Canvas implements Observer{
	
	private int ultimaVal=0;
	
	//notifica obiectele atunci cand se face o schimbare
	public void upDate(Subject s){
	ultimaVal=s.getVal();
	repaint();
}
	//updateaza interfata grafica
	public void update(Graphics g){
		super.update(g);
	}
	
	//deseneaza obiectele
	public void paint(Graphics g){
		g.drawRect(0, 0, 80,20);
		g.setColor(Color.blue);
		g.fillRect(0, 0, ultimaVal, 20);
	}

}
